<div class="row">
	<div class="col-xs-12 col-md-12">
		<div class="widget">
			<div class="widget-header bg-blue">
				<i class="widget-icon fa fa-arrow-down"></i>
				<span class="widget-caption">会员提现订单</span>
				<div class="widget-buttons">
					<a href="#" data-toggle="maximize">
						<i class="fa fa-expand"></i>
					</a>
					<a href="#" data-toggle="collapse">
						<i class="fa fa-minus"></i>
					</a>
					<a href="#" data-toggle="dispose">
						<i class="fa fa-times"></i>
					</a>
				</div>
			</div>
			<div class="widget-body">
				<div class="table-toolbar">
					<a id="Joel-txok" href="#" class="btn btn-success">
						<i class="fa fa-delicious"></i>提现
					</a>
					<button href="javascript:void(0)" class="btn btn-primary" id="exportTxorder"><i class="fa fa-save"></i>导出提现订单</button>
					<div class="pull-right">
						<form id="Joel-search">
							<label style="margin-bottom: 0px;">
								<select name="stype" class="form-control input-sm">
									<option value='1' <eq name='stype' value='1'>selected</eq>>按会员ID</option>
									<option value='2' <eq name='stype' value='2'>selected</eq>>按提现姓名</option>
								</select>								
							</label>
							<label style="margin-bottom: 0px;">
								<input name="name" type="search" class="form-control input-sm" placeholder="按提现姓名搜索">
							</label>
							<a href="{:U('Cms/Vip/txorder/')}" class="btn btn-success" data-loader="Joel-loader" data-loadername="商城订单" data-search="Joel-search">
								<i class="fa fa-search"></i>搜索
							</a>
						</form>
					</div>
				</div>

				<table id="Joel-table" class="table table-bordered table-hover">
					<thead class="bordered-darkorange">
						<tr role="row">
							<th width="30px"><div class="checkbox" style="margin-bottom: 0px; margin-top: 0px;">
									<label style="padding-left: 4px;"> <input type="checkbox" class="Joel-checkall colored-blue">
                                     <span class="text"></span>
									</label>                                    
                                </div></th>
							<th>ID</th>
							<th>VIPID</th>
							<th>提现金额</th>
							<th>提现姓名</th>
							<th>提现电话</th>
							<th>提现银行</th>							
							<th>提现分行</th>
							<th>提现银行所在地</th>
							<th>提现卡号</th>
							<th>申请时间</th>
						    <th>操作</th>
						</tr>
					</thead>
					<tbody>
						<volist name="cache" id="vo">
							<tr id="item{$vo.id}">
								<td>
									<div class="checkbox" style="margin-bottom: 0px; margin-top: 0px;">
										<label style="padding-left: 4px;"> <input name="checkvalue" type="checkbox" class="colored-blue Joel-check" value="{$vo.id}">
	                                     <span class="text"></span>
										</label>                                    
	                                </div>
								</td>
								<td class=" sorting_1">{$vo.id}</td>
								<td class=" ">{$vo.vipid}</td>
								<td class=" ">{$vo.txprice}</td>
								<td class=" ">{$vo.txname}</td>
								<td class=" ">{$vo.txmobile}</td>
								<td class=" ">{$vo.txyh}</td>
								<td class=" ">{$vo.txfh}</td>
								<td class=" ">{$vo.txszd}</td>
								<td class=" ">{$vo.txcard}</td>
								<td class=" ">{$vo.txsqtime|date='Y/m/d H:i',###}</td>
								<td class="center ">
									<eq name="vo.status" value="1"><button class="btn btn-danger btn-xs txordercancel" data-id = "{$vo.id}"><i class="glyphicon glyphicon-remove"></i> 取消申请</button></eq>
								</td>
							</tr>
						</volist>
												
					</tbody>
				</table>
				<div class="row DTTTFooter">
					{$page}
				</div>
			</div>
		</div>
	</div>
</div>
<!--面包屑导航封装-->
<div id="tmpbread" style="display: none;">{$breadhtml}</div>
<script type="text/javascript">
	setBread($('#tmpbread').html());
</script>
<!--/面包屑导航封装-->
<!--全选特效封装/全部删除-->
<script type="text/javascript">
	//全选
	var checkall=$('#Joel-table .Joel-checkall');
	var checks=$('#Joel-table .Joel-check');
	var trs=$('#Joel-table tbody tr');
	$(checkall).on('click',function(){
		if($(this).is(":checked")){			
			$(checks).prop("checked","checked");
		}else{
			$(checks).removeAttr("checked");
		}		
	});
	$(trs).on('click',function(){
		var c=$(this).find("input[type=checkbox]");
		if($(c).is(":checked")){
			$(c).removeAttr("checked");
		}else{
			$(c).prop("checked","checked");
		}		
	});
	//批量提现完成
	$('#Joel-txok').on('click',function(){
		var checks=$(".Joel-check:checked");
		var chk='';
		$(checks).each(function(){
			chk+=$(this).val()+',';
		});
		if(!chk){
			$.Joel.alert('danger','请选择要提现的项目！');
			return false;
		}
		var toajax="{:U('Cms/Vip/txorderOk')}"+"/id/"+chk;
		var funok=function(){
			var callok=function(){
				//成功删除后刷新
				$('#refresh-toggler').trigger('click');
				return false;
			};
			var callerr=function(){
				//拦截错误
				return false;
			};
			$.Joel.ajax('post',toajax,'nodata',callok,callerr);
		}						
		$.Joel.confirm("确认要批量完成提现吗？此操作不可逆转！",funok);
	});
	
		
	//提现取消
	var btntxcancel=$('.txordercancel');
	$(btntxcancel).on('click',function(){
		var id=$(this).data('id');
		var funok=function(){			
			$.ajax({
				type:"post",
				url:"{:U('Cms/Vip/txorderCancel')}",
				async:false,
				data:{'id':id},
				success:function(info){
				    if(info['status']){
				           $.Joel.alert('success',info['msg']);			                        				
				           $('#Joel-reloader').trigger('click');
				    }else{
				           $.Joel.alert('danger',info['msg']);			                        				
				         }
				         return false;
				   },
				error:function(xhr){
					$.Joel.alert('danger','通讯失败！请重试！');
					return false;
				}
			});
		}
		$.Joel.confirm("确认要取消此笔提现操作吗？此操作不可逆转！",funok);
	
	});
		
		
	//导出提现帐单
	$('#exportTxorder').on('click',function(){
		var checks=$(".Joel-check:checked");
		var chk='';
		$(checks).each(function(){
			chk+=$(this).val()+',';
		});
		window.open("{:U('Cms/Vip/txorderExport')}/status/{$status}/id/"+chk);
	})
</script>
<!--/全选特效封装-->


	